import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/login.vue'
import Register from '../views/register.vue'
import Personal from '../views/Personal.vue'
import Editpro from '../views/Editor.vue'
import Focuspage from '../views/focuspage.vue'
import Comment from '../views/comment.vue'
import Index from '../views/index.vue'
import Manager from '../views/management.vue'
import Index2 from '../views/index2.vue'
import Detailpost from '../views/Detail.vue'
import Collect from '../views/collect.vue'
import Text from '../views/text.vue'
import Morecontent from '../views/moreContent.vue'
import Search from '../views/search.vue'

Vue.use(VueRouter)

const routes = [{ //主页部分
        path: '/',
        name: 'Home',
        component: Home
    },
    { // 登录页
        path: '/login',
        name: 'login',
        component: Login
    },
    { //注册页
        path: '/register',
        name: 'register',
        component: Register
    },
    { //个人中心页
        path: '/personal',
        name: 'personal',
        component: Personal,
        meta: {
            needAuth: true
        }
    },
    { //编辑信息页
        path: '/editpro',
        name: 'editpro',
        component: Editpro,
        meta: {
            needAuth: true
        }
    },
    { //关注页面
        path: '/focuspage',
        name: 'focuspage',
        component: Focuspage,
        meta: {
            needAuth: true
        }
    },
    { //跟帖页面
        path: '/comment',
        name: 'comment',
        component: Comment
    },
    { //首页路由
        path: '/index',
        name: 'index',
        component: Index,
    }, {
        // 栏目管理
        path: '/manage',
        name: 'manage',
        component: Manager,
    },
    { //第二次做首页
        path: '/index2',
        name: 'index2',
        component: Index2,
    },
    { //收藏页
        path: '/collect',
        name: 'collect',
        component: Collect,
    },
    { //文章详情页
        path: '/detailpost',
        name: 'detailpost',
        component: Detailpost,
    },
    { //测试页
        path: '/text',
        name: 'text',
        component: Text,
    },
    // 更多评论
    {
        path: '/morecontent',
        name: 'morecontent',
        component: Morecontent,
    },
    // 搜索页
    {
        path: '/search',
        name: 'search',
        component: Search,
    },
]

const router = new VueRouter({
    routes
})

export default router